package com.logos.reflect;

import com.logos.entity.Student;

public class ThreeClass {

    public static void main(String[] args) throws ClassNotFoundException {
        // 1. Class.forName("全类名")
        Class<?> clazz1 = Class.forName("com.logos.entity.Student");
        System.out.println(clazz1);
        // 2. 类名.class
        Class<Student> clazz2 = Student.class;
        System.out.println(clazz2);
        // 3. 对象.getClass()
        Student student = new Student();
        Class<? extends Student> clazz3 = student.getClass();
        System.out.println(clazz3);
        System.out.println(clazz1 == clazz2 && clazz2 == clazz3 && clazz1 == clazz3);
    }
}
